1. Field of the Invention
The present invention relates to a magnetic sensor, and more particularly, to a magnetic sensor, which has a configuration of externally pulling up an output terminal, and to a magnetic sensor device.
2. Description of the Related Art
A magnetic sensor device includes a magnetic detection element, which is configured to convert a magnetic flux density into an electric signal, to electrically determine which of the magnetic flux density, which is changed depending on a change in relative distance from a member to be detected including a magnetic body, and a preset magnetic flux density threshold is larger or smaller, and to output a detection signal of a two-level voltage. In a switching system using a magnetic sensor, especially in the automotive field, in order to provide safety to a user of an automatic vehicle, it is required to construct a system from the viewpoint of functional safety (ISO 26262). For example, it is required to eliminate the fear that an erroneous switching operation may be performed due to a failure of a magnetic sensor element itself, or a failure of a signal transmission path in the system.
In FIG. 4, a related-art magnetic sensor device is illustrated. A magnetic sensor 50 includes a signal processing circuit 51 including a magnetic sensor, a transistor 52, a constant current circuit 53, and a resistor 54. A discrimination circuit 59 is connected to GND in common with the magnetic sensor 50, and has a terminal IN connected to a terminal OUT of the magnetic sensor 50. Further, the magnetic sensor 50 has a terminal IN pulled up to a voltage VDD by a pull-up resistor 58.
The magnetic sensor 50 outputs two values: a high level value, which is lower than the voltage VDD by a predetermined value, and a low level value, which is higher than the voltage GND by a predetermined value, to the terminal OUT. The discrimination circuit 59 has an abnormality detection function of determining an abnormality when an input voltage level is a voltage other than voltages in the vicinity of those two values.
With such a configuration in which a predetermined voltage level that is not equivalent to the voltage VDD and the voltage GND is determined as normal, abnormalities, such as disconnection of an input terminal, may be easily detected. For example, when wiring between the terminal OUT of the magnetic sensor 50 and the terminal IN of the discrimination circuit 59 is disconnected and opened, the input level of the discrimination circuit 59 becomes the voltage VDD, and hence an abnormality is determined. Moreover, when the wiring between the terminal OUT of the magnetic sensor 50 and the terminal IN of the discrimination circuit 59 is short-circuited to the voltage GND, the input level of the discrimination circuit 59 becomes the voltage GND, and hence an abnormality is determined.
In the case of the above-mentioned circuit configuration, the input voltage level of the discrimination circuit 59 in normality is determined by the resistor 54, the constant current circuit 53, the transistor 52, and the pull-up resistor 58. The pull-up resistor 58 is varied in resistance value due to a variation in manufacturing, with the result that the input voltage level is varied.